package com.css.apps.base.user.action;

import com.css.apps.base.user.po.UserInfoDialogVo;
import com.css.apps.base.user.service.UserService;
import com.css.util.Messages;
import com.css.util.StringHelper;
import com.opensymphony.xwork.Action;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@SuppressWarnings("serial")
public class GetUserInfoDialog extends UserAction {
	private static Log log = LogFactory.getLog(GetUserInfoDialog.class);
	private String uuid;
	private String userId;
	private String lableId;
	private String pageName; //转发的用户数据信息页面名称
	private UserInfoDialogVo userInfoDialogVo;
	private String operFlag="add";

	@SuppressWarnings("unchecked")
	public String userGo() {
		try {
			if(StringHelper.isNotEmpty(uuid)){
				UserService userService = new UserService();
				userInfoDialogVo = userService.createUserInfoDialogVo(lableId, uuid);
				operFlag = userService.getOperFlag();
			}
			this.pageName = lableId.toLowerCase() + "mini.jsp";
			return Action.SUCCESS;
		} catch (Exception ex) {
			log.error(ex.getMessage(), ex);
			setMessage(Messages.getString("systemMsg.exception"));
			return Action.ERROR;
		}
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getLableId() {
		return lableId;
	}

	public void setLableId(String lableId) {
		this.lableId = lableId;
	}

	public String getPageName() {
		return pageName;
	}

	public void setPageName(String pageName) {
		this.pageName = pageName;
	}

	public String getOperFlag() {
		return operFlag;
	}

	public void setOperFlag(String operFlag) {
		this.operFlag = operFlag;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public UserInfoDialogVo getUserInfoDialogVo() {
		return userInfoDialogVo;
	}

	public void setUserInfoDialogVo(UserInfoDialogVo userInfoDialogVo) {
		this.userInfoDialogVo = userInfoDialogVo;
	}
}
